<?php

namespace App\Http\Controllers\Admin\Auth;

use Auth;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;

class LoginController extends Controller
{
    use AuthenticatesUsers {
        logout as performLogout;
    }

    protected $redirectTo = '/api_admin';

    public function __construct()
    {
        $this->middleware('guest', ['except' => 'logout']);
    }

    protected function guard()
	{
	    return Auth::guard('admin');
	}

    /**
     * 自定义登出路径
     */
    public function logout(Request $request)
    {
        $this->performLogout($request);
        return redirect('/api_admin');
    }
}
